<template>
  <div>
    <button @click="click">home+1</button>
    我是home
    {{name}}{{counter}}
  </div>
</template>

<script>
import { inject } from 'vue'
export default {
  setup() {
   const name =  inject('name')
   let counter =  inject('counter')
   const click = () => {
     counter.value++
   }
   return {
     name,
     counter,
     click
   }
  }
}
</script>

<style>

</style>